<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML" 4.01"//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- Created: November 30, 2004-->
<html>
<head>
<title>Radiological Equipment Database</title>
<meta name="author" content="Eugene Mah">
<link rev="made" href="mailto:eugenem@ix.netcom.com">
<link rev="home" href="http://home.netcom.com/~eugenem/">
<meta name="description" content="">
<meta name="Keywords" content="">
<meta name="Reply-to" content="eugenem@ix.netcom.com">
<META http-equiv="PICS-Label" content='(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~0001))'>
<?PHP
require('functions.inc');
require('dbc.inc');


?>
</head>

<body>
<h1>Radiological Equipment Database</h1>
<?PHP
$machine = mysql_query("select MachineID,Description from Machines where Status=\"Active\" order by Description");

if (isset($MachID) && $submit) {
  $today = date("Y-m-d");  // Get today's date in YYYY-MM-DD format
  
  // Escape any quotes in $Recommendation
  $OpNote = addslashes($OpNote);
  
  $query = "INSERT INTO OperationalNotes (MachineID,NoteDate,Note)
            VALUES ($MachID,\"$today\",\"$OpNote\")";
  $result = mysql_query($query)
    or die ("Insert query: $query failed<br>\n");

  echo "<h2>Operational Note added</h2>\n";
  echo "<p>$OpNote for Machine $MachID has been added</p>\n";
}
else {
  $MachID=0;
}
?>
<h2>Add Operational Note</h2>
<form action="<?PHP echo $_SERVER['PHP_SELF']; ?>" method="POST">
<p>Select machine: <?PHP echo listbox_field($machine,"MachID",$MachID); ?></p>
<p><textarea name="OpNote" rows="3" cols="70">Enter operational note</textarea></p>
<p>
<input type="SUBMIT" name="submit" value="Add Op Note"> /
<input type="RESET" value="Reset"> /
<a href="index.html" target="_top" >Main</a></p>
</form>

</body>
</html>
